package com.zzq.mapper;

import com.zzq.pojo.TenderInfo;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface TendererInfoMapper {
    @Select("select * from tender_info where state!='待审核'")
    List<TenderInfo> list();

    @Select("select * from tender_info where state='待审核'")
    List<TenderInfo> some();

    @Update("update tender_info set state='投标' where tender_project_no=#{no}")
    void check(int no);

    @Delete("delete from tender_info where tender_project_no=#{no}")
    void elect(int no);

    List<TenderInfo> select(String manufacturer, String state);

    @Select("select * from tender_info where manufacturer=#{name}")
    List<TenderInfo> selectByName(String name);

    @Insert("insert into tender_info values(#{tenderProjectNo},#{drugName},#{manufacturer},#{packagingReq},#{totalNumber},#{tenderDeadline},#{bidDeposit},#{state})")
    void add(TenderInfo tenderInfo);

    @Update("update tender_info set drug_name=#{drugName},packaging_req=#{packagingReq},total_number=#{totalNumber},tender_deadline=#{tenderDeadline},bid_deposit=#{bidDeposit} where tender_project_no=#{tenderProjectNo}")
    void update(TenderInfo tenderInfo);
}
